Data processing method, data processing apparatus, communications device, communications method, communications protocol and program

ABSTRACT

To prevent a command from being unsmoothly issued when a communications channel (LUN) from a conventional initiator to a target enters communications disabled state for any reason there is provided, a data processing method for use between two nodes which are connected to a serial bus and perform communications by a plurality of logical communications units, in which, in the plurality of logical communications units, a first logical communications unit is used in data communications from an initiator to a target, a second logical communications unit is used in data communications from a target to an initiator, and a control command issued from the initiator to the target can be issued to and received by both logical communications units.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to a data processing method, a dataprocessing apparatus, a printer, a communications protocol, a storagemedium, etc. for performing a data communicating process.

[0003] 2. Related Background Art

[0004] When communications are established through one-to-one connectionbetween a host and a device in various interfaces such as Centronics,USB, IEEE 1394, etc., the communications are performed by setting aplurality of logical communications units in a session of acommunications protocol, that is, a logical channel connection, tocontrol various functions of devices between a host and a device.

[0005] These logical channels are flow-controlled (communicationscontrol) for each channel. Normally, when a plurality of logicalchannels are used, there can be a configuration in which two types oflogical channels, that is, a channel from the host to the device and achannel from the device to the host according to a data transferdirection, are provided, a configuration in which a plurality ofbidirectional logical channels are provided for each control function,etc.

[0006] However, when data cannot be transmitted/received through alogical channel for any reason, a control command itself for getting thetransmission/reception back to normal cannot be transmitted to thelogical channel. If the data transfer of a channel from the host to thedevice cannot be smoothly performed when a one-way data channel isprovided for each data transfer direction, then it is obvious thatcommand data cannot be transmitted from the host to the device throughthe channel. Furthermore, when flow control is not smoothly performed ina channel unit with a bidirectional logical channel provided for eachcontrol function, the command cannot be transmitted through the channel.

SUMMARY OF THE INVENTION

[0007] An object of the present invention is to solve each of the abovementioned problems.

[0008] In a data processing method used between two nodes which areconnected to a serial bus and perform communications through a pluralityof logical communications units, the data processing apparatus accordingto the present invention uses a first logical communications unit indata communications from an initiator to a target, and a second logicalcommunications unit in data communications from the target to theinitiator in the plurality of the logical communications units, wherein

[0009] a control command issued from the initiator to the target can betransmitted from and received by both logical communications units.

[0010] The communications device according to the present inventionperforms communications through a first channel for use in a datatransfer from a target to an initiator, and a second channel for use ina data transfer from the initiator to the target, and includes:

[0011] a detection unit for detecting an error when the first channel isused to issue a specified command; and

[0012] an issue unit for issuing a specified command using the secondchannel when the detection unit detects an error.

BRIEF DESCRIPTION OF THE DRAWINGS

[0013]FIG. 1 shows a configuration of the system according to anembodiment of the present invention;

[0014]FIG. 2 shows a configuration of the network of a 1394 serial bus;

[0015]FIG. 3 shows components of the 1394 serial bus according to thepresent invention;

[0016]FIG. 4 shows a service capable of providing a link layer of the1394 serial bus according to the present invention;

[0017]FIG. 5 shows a service capable of providing a transaction layer ofthe 1394 serial bus according to the present invention;

[0018]FIG. 6 is an explanatory view of an address space in the 1394interface;

[0019]FIG. 7 shows the address and function of information stored in theCSR core register in the 1394 interface;

[0020]FIG. 8 shows address and function of information stored in aserial bus register in the 1394 interface;

[0021]FIG. 9 shows the Configuration ROM in the smallest format in the1394 interface;

[0022]FIG. 10 shows a Configuration ROM of a common format in the 1394interface;

[0023]FIG. 11 shows the address and function of the information storedin the serial bus device register in the 1394 interface;

[0024]FIG. 12 is a sectional view of a communications cable inaccordance with the IEEE 1394 standard;

[0025]FIG. 13 is an explanatory view of a DS-Link coding system;

[0026]FIG. 14 shows a basic sequence from a start of a bus reset to aprocess of assigning a node ID;

[0027]FIG. 15 shows a basic sequence from the start of a bus reset tothe process of assigning a node ID;

[0028]FIG. 16 shows a basic sequence from the start of a bus reset tothe process of assigning a node ID;

[0029]FIG. 17 is a flowchart showing in detail a process of step S1505shown in FIG. 15 (that is, the process of automatically assigning a nodeID of each node);

[0030]FIG. 18 shows a configuration of a self ID packet in the 1394interface;

[0031]FIGS. 19A and 19B are explanatory views of an arbitration in the1394 network;

[0032]FIG. 20 is an explanatory view of the case in which an isochronoustransfer mode and an asynchronous transfer mode coexist in onecommunications cycle;

[0033]FIG. 21 shows a format of a communications packet transferredbased on an isochronous transfer mode;

[0034]FIG. 22 shows a packet format in an asynchronous transfer modeaccording to the present invention;

[0035]FIG. 23 shows an ORB type in an SBP-2;

[0036]FIG. 24 shows a format of a command block ORB in the SBP-2;

[0037]FIG. 25 shows a format of management ORB in the SBP-2;

[0038]FIG. 26 shows a link list of a command block ORB in the SBP-2;

[0039]FIG. 27 shows a direct access of a data buffer in the SBP-2;

[0040]FIG. 28 shows a use of a page table in the SBP-2;

[0041]FIG. 29 shows a format of a status FIFO in the SBP-2;

[0042]FIG. 30 shows a login operation in the SBP-2;

[0043]FIG. 31 shows a first operation of performing a task in the SBP-2;

[0044]FIG. 32 shows an operation of a command ORB in the SBP-2;

[0045]FIG. 33 is a block diagram of an IEEE interface unit between aprinter and a host according to an embodiment of the present invention;

[0046]FIG. 34 shows a configuration ROM of a printer according to anembodiment of the present invention;

[0047]FIG. 35 shows an 1394 address space of a printer according to anembodiment of the present invention;

[0048]FIG. 36 shows a core CSR register of a printer according to anembodiment of the present invention;

[0049]FIG. 37 shows a format of a command ORB defined by a printercontrol communications command protocol for use between a printer and ahost according to an embodiment of the present invention; and

[0050]FIG. 38 shows a command defined by the printer controlcommunications command protocol for use between the printer and the hostaccording to an embodiment of the present invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0051]FIG. 1 is a best view showing the present invention, and shows ahost computer (hereinafter referred to as a host) A and a printer Bconnected through IEEE 1394.

[0052] The communications between the computer A (initiator) and theprinter B (target) are performed by using an SBP (serial bus protocol)-2protocol, which is a typical data transfer protocol used in the 1394interface, and a logical channel logical communications unit LUN 0 forthe data transfer from a host to a printer, and a logical channellogical communications unit LUN 1 for the data transfer from a printerto a host are predetermined. The SBP-2 will be outlined later.

[0053] <Outline of the Technology of IEEE 1394>

[0054] Described below briefly will be the technology of the IEEE1394-1995 Standard applied to the digital interface according to anembodiment of the present invention. The IEEE 1394-1995 Standard(hereinafter referred to as IEEE 1394 Standard) is described in detailin ‘IEEE Standard for a High Performance Serial Bus’ published by IEEE(The Institute of Electrical and Electronics Engineers, Inc.) on Aug.30, 1996.

[0055] (1) Outline

[0056]FIG. 2 shows an example of a communications system (hereinafterreferred to as a 1394 network) configured by a node provided with adigital interface (hereinafter referred to as a 1394 interface) inaccordance with the IEEE 1394 Standard. The 1394 network forms a bustype network capable of communicating serial data.

[0057] In FIG. 2, each of the nodes A to F is connected through acommunications cable in accordance with the IEEE 1394 Standard. Thesenodes A to H are electronic equipment such as a PC (personal computer),a digital VTR (video tape recorder), a DVD (digital videodisc) player, adigital camera, a hard disk, a monitor, etc.

[0058] The connection system of the 1394 network corresponds to a daisychain system and a node branch system, and can realize a highly flexibleconnection.

[0059] In the 1394 network, a bus reset is automatically performed when,for example, existing equipment is deleted, new equipment is added, thepower source of existing equipment is turned ON/OFF. By performing thebus reset, the 1394 network can automatically recognize a new connectionconfiguration and assign ID information to each piece of equipment.Using the function, the 1394 network can constantly recognize theconnection configuration of the network.

[0060] Additionally, the 1394 network has the function of relaying datatransferred from other equipment. Thereby, all equipment can graspoperating states of the bus.

[0061] Additionally, the 1394 network has the function referred to asPlug & Play through which the connection equipment can be automaticallyrecognized only by a connecting operation without turning off the powerof all equipment.

[0062] The 1394 network corresponds to the data transfer speed of100/200/400 Mbps. Equipment having a higher data transfer speed cansupport sequentially having a lower data transfer speed. Therefore,pieces of equipment having different data transfer speeds can beconnected to each other.

[0063] Furthermore, the 1394 network corresponds to two different datatransfer systems (that is, an asynchronous transfer mode and anisochronous transfer mode).

[0064] The asynchronous transfer mode is effective when data requestedto be asynchronously transferred as necessary (that is, a controlsignal, a file data, etc.) is to be transferred. The isochronoustransfer mode is effective when a predetermined amount of data requestedto be continuously transferred at a constant data rate (that is, videodata, audio data, etc.) is to be transferred.

[0065] The asynchronous transfer mode and the isochronous transfer modecan coexist in each communications cycle (one communications cycle isnormally 125 μS). Each transfer mode is executed after transferring acycle start packet (hereinafter referred to as a CSP) indicating thestart of a cycle.

[0066] In each communications cycle period, the isochronous transfermode is set higher in priority than the asynchronous transfer mode.Additionally, the transfer band of the isochronous transfer mode isguaranteed in each communications cycle.

[0067] (2) Architecture

[0068] The components of the 1394 interface will be described below byreferring to FIG. 3.

[0069] The 1394 interface is formed by a plurality of functional layers(hierarchy). In FIG. 3, the 1394 interface is connected to a 1394interface of another node through a communications cable 301 inaccordance with the IEEE 1394 Standard. The 1394 interface has one ormore communications ports 302, and the communications port 302 isconnected to a physical layer 303 contained in a hardware unit.

[0070] In FIG. 3, the hardware unit is formed by the physical layer 303and a link layer 304. The physical layer 303 provides a physical andelectrical interface with another node, performs a process of, andassociated with, detecting a bus reset, codes/decodes an input/outputsignal, arbitrates a bus use right, etc. The link layer 304 generatesand transmits/receives a communications packet, controls a cycle timer,etc.

[0071] In FIG. 3, a firmware unit includes a transaction layer 305 and aserial bus management 306. The transaction layer 305 manages theasynchronous transfer mode, and provides various transactions (read,write, and lock). The serial bus management 306 provides the functionsof controlling its node, managing the connection state of its node,managing the ID information about its node, and managing the resourcesof a serial bus network based on the CSR architecture described later.

[0072] As described above, the hardware unit and the firmware unitpractically form the 1394 interface, and the basic configuration isregulated by the IEEE 1394 Standard.

[0073] An application layer 307 contained in a software unit depends onthe used application software, and controls the communications of datain a network. For example, moving picture data of digital VTR isregulated by a communications protocol such as AV/C protocol, etc.

[0074] (2-1) Link Layer 304

[0075]FIG. 4 shows a service to be provided by the link layer 304. InFIG. 4, the link layer 304 provides the following four services. Thatis, <1> a link request (LK_DATA.request) requesting a response node totransfer a predetermined packet, <2> a link notification(LK_DATA.indication) notifying a response node of reception of apredetermined packet, <3> a link response (LK_DATA.response) indicatingreception of an acknowledge from a request node, and <4> linkconfirmation (LK_DATA.confirmation) confirming an acknowledge from arequest node. The link response (LK_DATA.response) does not exist inbroadcast communications and isochronous packet transfer.

[0076] The link layer 304 realizes the above mentioned two type oftransfer systems, that is, the asynchronous transfer mode and theisochronous transfer mode, based on the above mentioned services.

[0077] (2-2) Transaction Layer 305

[0078]FIG. 5 shows a service which can be offered by the transactionlayer 305. In FIG. 5, the transaction layer 305 provides the followingfour services. That is, <1> a transaction request (TR_DATA.request)requesting a response node for a predetermined transaction, <2> atransaction notification (TR_DATA.indication) notifying a response nodeof reception of a predetermined transaction request, <3> a transactionresponse (TR_DATA.response) indicating reception of status information(including data for write and lock) from a response node, and <4>transaction confirmation (TR_DATA.confirmation) for confirming statusinformation from a request node.

[0079] The transaction layer 305 manages the asynchronous transfer basedon the above mentioned services, and realizes the following three typesof transactions, that is, <1> read transaction, <2> write transaction,<3> lock transaction.

[0080] <1> In the read transaction, the request node reads informationstored at a specified address of response node.

[0081] <2> In the write transaction, the request node writespredetermined information at a specified address of the response node.

[0082] <3> In the lock transaction, the request node transfers referencedata and updated data to the response node, compares the information atthe specified address of the response node with the reference data, andupdates the information at the specified address into the updated datadepending on the comparison result.

[0083] (2-3) Serial Bus Management 306

[0084] The serial bus management 306 practically provides the followingthree functions. That is, <1> node control, <2> isochronous resourcesmanager (hereinafter referred to as IRM), and <3> bus manager.

[0085] <1> In the node control, each of the above mentioned layers ismanaged, and the function of managing the asynchronous transfer betweennodes is provided.

[0086] <2> The IRM provides the function of managing the isochronoustransfer between nodes. Practically, the information required inassigning a transfer band width and a channel number is managed, and theinformation is provided for other nodes.

[0087] The IRM solely exists in a local bus, and is dynamically selectedfrom among other prospects (nodes having the functions of the IRM) foreach bus reset. The IRM can also provide a part of the functions(management of a connection configuration, management of a power source,management of speed information, etc.) provided by a bus manager as willbe described later.

[0088] <3> A bus manager has the functions of the IRM, and provides thefunction of managing a bus at a level higher than the IRM. Practically,higher level power source management (managing information for each nodeas to whether or not a power can be supplied through a communicationscable, whether or not power is to be supplied, etc.), higher level speedinformation management (managing maximum transfer speed between nodes),higher level connection configuration management (generating a topologymap), the optimization of a bus according to the above mentionedmanagement information, etc. are performed, and the obtained informationis provided for other nodes.

[0089] Furthermore, the bus manager can provide an application with aservice for controlling a serial bus network. The service can be aserial bus control request (SB_CONTROL.request), serial bus eventcontrol confirmation (SB_CONTROL.confirmation), serial bus eventnotification (SB_CONTROL.indication), etc.

[0090] SB_CONTROL.request is a service of an application requesting abus reset. SB_CONTROL.confirmation is a service of confirmingSB_CONTROL.request for the application. SB_CONTROL.indication is aservice of notifying the application of an event occurringasynchronously.

[0091] (3) Addressing

[0092]FIG. 6 shows an address space in the 1394 interface. The 1394interface prescribes an address space of a 64-bit width according to theCSR (command and status register) architecture in accordance with theISO/IEC 13213:1994.

[0093] In FIG. 6, the first 10-bit field 601 is used for an ID numberspecifying a predetermined bus, and the next 6-bit field 602 is used foran ID number specifying a predetermined equipment (node). The high order16 bits are referred to as a node ID, and each node identifies anothernode by the node ID. Each node can communicate with a partner identifiedby the node ID.

[0094] The remaining 48-bit field specifies an address space (256 M bytestructure) of each node. Among them, a 20-bit field 603 specifies aplurality of areas forming an address space.

[0095] In the field 603, the ‘0 to 0 x FFFFD’ portion is referred to asa memory space. The portion of ‘0 x FFFFE’ is referred to as a privatespace which can be freely used in each node. The portion of ‘0 x FFFFE’is referred to as a register space, and stores common informationbetween nodes connected through a bus. Each node can manage thecommunications between nodes using the information about the registerspace.

[0096] The last 28-bit field 604 specifies an address storing common orunique information in each node.

[0097] For example, in the register space, the first 512 bytes are usedfor a core (CSR core) register of a CSR architecture. The address andfunction of the information stored in the CSR core register are shown inFIG. 7. The offset in FIG. 7 is a relative position from ‘0 xFFFFF0000000’.

[0098] The next 512 bytes are used as a register for a serial bus. FIG.8 shows the address and the function of the information stored in theserial bus register. The offset shown in FIG. 8 is a relative positionfrom ‘0 x FFFFF0000200’.

[0099] The next 1024 bytes are used for configuration ROM.

[0100] The configuration ROM has the smallest format and the commonformat, and is arranged from ‘0 x FFFFF0000400’. FIG. 9 shows theconfiguration ROM in the smallest format. In FIG. 9, the vendor ID is a24-bit value uniquely assigned to each vendor by the IEEE.

[0101]FIG. 10 shows a configuration ROM in the common format. In FIG.10, the above mentioned vendor ID is stored in a root directory 1002. Abus info block 1001 and a root leaf 1005 can hold a node unique ID asunique ID information for identification of each node.

[0102] A node unique ID refers to a unique ID for designation of onenode regardless of manufacturer and model. The node unique ID is formedby 64 bits with high order 24 bits indicating the above mentioned vendorID, and low order 48 bits indicating the information which can be freelyset by a manufacturer of each node (for example, a production number,etc. of a node). The node unique ID is used when a specified node isrecognized by, for example, checking it before and after a bus reset.

[0103] In FIG. 10, the root directory 1002 can hold information about abasic function of a node. Detailed information about the function isstored in a subdirectory (unit directories 1004) at an offset accordingto the root directory 1002. The unit directories 1004 stores, forexample, the information about a software unit supported by a node.Practically, the information about a data transfer protocol for datacommunications between nodes, a command set for definition of apredetermined communications procedure, etc. are held.

[0104] In FIG. 10, a node dependent info directory 1003 can hold uniqueinformation about a device. The node dependent info directory 1003 isoffset according to the root directory 1002.

[0105] Furthermore, in FIG. 10, a vendor dependent information 1006 canhold unique information about a vendor which produces or sells a node.

[0106] The remaining area is referred to as a unit space, and specifiesan address storing unique information about each node, for example,identification information (company name, model name, etc.), a usecondition, etc. of each equipment. FIG. 11 shows the address andfunction of information stored in a serial bus device register in a unitspace. The offset in FIG. 11 is a relative position from ‘0 xFFFFF0000800’.

[0107] Normally, when the design of a different bus system is to besimplified, each node is to use only the first 2048 bytes in theregister space. That is, it is desired to configure it by a total of4096 bytes of a CSR core register, a serial bus register, configurationROM, the first 2048 bytes of a unit space.

[0108] (4) Configuration of Communications Cable

[0109]FIG. 12 is a sectional view of a communications cable inaccordance with the IEEE 1394 Standard.

[0110] The communications cable is configured by a two sets of twistpair signal lines and a power line. By providing a power line, the 1394interface can provide electric power for equipment whose main power hasbeen turned OFF, equipment whose power has been lowered by a failure,etc. It is prescribed that the voltage of power in the power line is 8to 40 V, and the current is the maximum current of DC 1.5 A.

[0111] An information signal coded in the DS-Link (data/strobe link)coding system is transmitted to the two sets of twist pair signal lines.FIG. 13 shows the DS-Link coding system.

[0112] The DS-Link coding system can be applied to high-speed serialdata communications, and the configuration requires two sets of twistedpair lines. A set of twisted pair lines transmits a data line, andanother set of twisted pair lines transmits a strobe signal. Thereceiver can regenerate a clock by obtaining an exclusive-OR between adata signal and a strobe signal received through the two sets of signallines.

[0113] In the DS-Link coding system, the 1394 interface has, forexample, the following merits, that is: <1> higher transfer efficiencythan other coding systems; <2> requiring no PLL circuits, therebyreducing a circuit scale of a controller LSI; and <3> transmitting noinformation about an idle state, thereby easily setting a sleep state ofa transceiver circuit and reducing power consumption.

[0114] (5) Bus Reset

[0115] The 1394 interface of each node automatically detects a change inthe connection configuration of a network. In this case, the 1394network performs a process referred to as a bus reset in the followingprocedure. A change in the connection configuration can be detected by achange in a bias voltage in the communications port provided for eachnode.

[0116] A node in which a change in the connection configuration of anetwork (for example, the increase/decrease of the number of nodes byinserting/removing a node, turning ON/OFF of power for a node, etc.) isdetected, or a node requiring the recognition of a new connectionconfiguration transmits a bus reset signal on a bus through the 1394interface.

[0117] The 1394 interface of a node which has received a bus resetsignal transmits the occurrence of the bus reset to its link layer 304,and transfers the bus reset signal to another node. The node which hasreceived the bus reset signal clears the connection configuration of thenetwork which has been recognized, and the node ID assigned to eachequipment. After all nodes have finally detected the bus reset signal,each node automatically performs an initializing process (that is,recognizing a new connection configuration and assigning a new node ID)accompanying the bus reset.

[0118] The bus reset can also be activated by the control of the hostside for issuing an instruction directly to the physical layer 303 bythe application layer 307 in addition to the activation by a change ofthe connection configuration as described above.

[0119] When the bus reset is activated, the data transfer isinterrupted, and then resumed in a new network after completing theinitializing process accompanying the bus reset.

[0120] (6) Sequence After Activating a Bus Reset

[0121] After activating the bus reset, the 1394 interface of each nodeautomatically recognizes a new connection configuration and assigns anew node ID. The basic sequence from the start of the bus reset to thenode ID assigning process by referring to FIGS. 14 to 16.

[0122]FIG. 14 shows the state after the activation of a bus reset in the1394 network shown in FIG. 2.

[0123] In FIG. 14, a node A has a communications port, a node B has twocommunications ports, a node C has two communications ports, a node Dhas three communications ports, a node E has a communications port, anda node F has a communications port. The communications port of each nodeis assigned a port number for identification of each port.

[0124] The process from the start of the bus reset to assigning a nodeID as shown in FIG. 14 will be described below by referring to theflowchart shown in FIG. 15.

[0125] In FIG. 15, each of the nodes A to F forming the 1394 networkconstantly monitors whether or not the bus reset has occurred (stepS1501). When a bus reset signal is output from the node which detects achange in a connection configuration, each node performs the followingprocess.

[0126] After the occurrence of a bus reset signal, each of the nodesdeclares a set membership among the respective communications ports ofthe nodes (step S1502).

[0127] Each node repeatedly performs the process in step S1502 until theset memberships in all nodes are determined (step S1503).

[0128] After the set memberships in all nodes are determined, the 1394network determines a node which arbitrates the network, that is, a root(step S1504).

[0129] After the root has been determined, the 1394 interface of eachnode performs an operation of automatically setting its own node ID(step S1505).

[0130] Until the node IDs are set for all nodes, each node performs theprocess in step S1505 in the predetermined procedure (step S1506).

[0131] After the node IDs are finally set for all nodes, each nodeperforms the isochronous transfer or the asynchronous transfer (stepS1507).

[0132] When the process in step S1507 is performed, the 1394 interfaceof each node monitors the occurrence of a bus reset again. When a busreset occurs, the processes in and after step S1501 are performed again.

[0133] In the above mentioned procedure, the 1394 interface of each nodecan automatically recognize a new connection configuration and assign anew node ID each time when the bus reset is activated.

[0134] (7) Determining Set Membership

[0135] Then, by referring to FIG. 16, the process in step S1502 shown inFIG. 15 (that is, the process of recognizing the set membership betweennodes) will be described in detail.

[0136] In FIG. 16, after the occurrence of a bus reset, each of thenodes A to F in the 1394 network confirms the connection status(connected or unconnected) of the communications port provided in eachnode (step S1601).

[0137] After confirming the connection status of the communicationsport, each node counts the number of communications ports connected toanother node (hereinafter referred to as a connection port) (stepS1602).

[0138] If the number of connection ports is 1 as a result of the processin step S1602, then the node recognizes it as a leaf (step S1603). Aleaf refers to a node connected only to one node.

[0139] The node which is a leaf declares that it is a child to a nodeconnected to the connection port (step S1604). At this time, the leafrecognizes that the connection port is a ‘parent port (a communicationsport connected to the parent node)’.

[0140] The declaration of a set membership is first made between a leafand a branch which are ends in a network, and then sequentially madebetween branches. The set memberships between nodes are sequentiallydetermined from a communications port which is the first to declare it.Between nodes, a communications port which declares a child isrecognized as a ‘parent port’, and a communications port receiving thedeclaration is recognized as a ‘child port (a communications portconnected to a child node)’. For example, in FIG. 14, after the nodes A,E, and F recognize that they are leaves, they declare a set membership.Thus, a child-parent relationship is determined between the nodes A andB, a child-parent relationship is determined between the nodes E and D,a child-parent relationship is determined between the nodes F and D.

[0141] If the number of connection ports is two or more as a result ofthe process in step S1602, then the node recognizes itself as a ‘branch’(step S1605). A branch refers to a node connected to two or more nodes.

[0142] A node which is a branch receives a declaration of a setmembership from a node of each connection port (step S1606). Theconnection port which receives the declaration is recognized as a ‘childport’.

[0143] After recognizing one connection port as a ‘child port’, thebranch detects whether or not there are two or more connection ports forwhich set memberships have not been determined (that is, undefinedports) (step S1607). As a result, if there are two or more undefinedports, the branch performs the operation in step S1606 again.

[0144] If there is only one undefined port as a result of step S1607,the branch recognizes that the undefined port is a ‘parent port’, anddeclares to the node connected to the port that it is a child (stepsS1608 and S1609).

[0145] At this time, the branch cannot declare to other nodes that it isa child until the number of the remaining undefined ports becomes 1. Forexample, in FIG. 14, the nodes B, C, and D recognize that they arebranches, and receive a declaration from a leaf or another branch. Thenode D declares a set membership to the node C after determining the setmemberships between D and E, and D and F. When the node C receives thedeclaration from the node D, it declares the set membership to the nodeB.

[0146] If there are no undefined ports as a result of the process instep S1608 (that is, when all connection ports of the branch becomeparent ports), then the branch recognizes that it is a root (stepS1610).

[0147] For example, in FIG. 14, the node B in which all connection portsare parent ports now is recognized by other nodes as a root forarbitrating the communications in the 1394 network. Although the node Bis determined as a route in this case, any of other nodes can be a rootwhen the node B declares a set membership earlier than the node C. Thatis, any node can be a root depending on the declaring timing. Therefore,a root is not limited to the same node even with the same networkconfiguration.

[0148] Thus, the declaration of the set members for all connection portenables each node to recognize a connection configuration in the 1394network as a hierarchical structure (tree structure) (step S1611). Theabove mentioned parent node is a high order node in the hierarchy, andthe child node is a low order node in the hierarchy.

[0149] (8) Assignment of Node ID

[0150]FIG. 17 is a flowchart showing in detail the process in step S1505(that is, the process of automatically assigning a node ID of each node)shown in FIG. 15. In FIG. 17, the node ID is formed by a bus number anda node number. In the present embodiment, it is assumed that each nodeis connected to the same bus, and each node is assigned the same busnumber.

[0151] In FIG. 17, the root enables a communications port having thesmallest number in the child ports to which nodes whose node IDs havenot been set are connected to set a node ID (step S1701).

[0152] In FIG. 17, when the root sets the node IDs of all nodesconnected to the child port having the smallest number, it completessetting the child port, and performs the same controlling operation onthe next smallest child port. When the IDs of all nodes connected to thechild port have been completely set, the root sets its own node ID. Thenode number 0, 1, 2, . . . contained in the node ID is sequentiallyassigned to a leaf, a branch, . . . basically in this order. Therefore,the root has the largest node number.

[0153] In step S1701, a node enabled to set a node determines whether ornot there are child ports including nodes whose node IDs have not beenset in its child ports (step S1702).

[0154] In step S1702, when a child port including an unset node isdetected, the above mentioned node enabled to set a node controls togive the node determines to a node directly connected to the child port(step S1703).

[0155] After the process in step S1703, the node enabled to set a nodedetermines whether or not there are child ports including a node whosenode ID has not been set in its child ports (step S1704). If there is achild port containing an unset node detected after the process in stepS1704, then the node performs the process in step S1703 again.

[0156] If there is no child port including an unset node detected instep S1702 or S1704, then the node enabled to set a node sets its ownnode ID (step S1705).

[0157] The node which sets its own node ID broadcasts a self-ID packetcontaining information about its own node number, the connection statusof a communications port, etc. (step S1706). To broadcast indicatestransferring a communications port in a node to unspecified many nodesforming the 1394 network.

[0158] Each node receives the self-ID packet, and recognizes the nodenumber assigned to each node, thereby being informed of the node numberassigned to it. For example, in FIG. 14, the node B which is a rootenables the node A connected to the communications port having thesmallest port number of #1 to set a node ID. The node A assigns the nodenumber of No. 0 to itself, and sets its own node ID formed by a busnumber and a node number. Then, the node A broadcasts the self-ID packetincluding the node number.

[0159]FIG. 18 shows an example of a configuration of a self-ID packet.In FIG. 18, reference numeral 1801 denotes a field storing the nodenumber of a node transmitting a self ID packet; reference numeral 1802denotes a field storing information about the applicable transfer speed;reference numeral 1803 denotes a field indicating the presence/absenceof the bus managing capability (capability of a bus manager, etc.); andreference numeral 1804 denotes a field storing information about thefeatures of the consumption and supply of electric power.

[0160] In FIG. 18, reference numeral 1805 denotes a field storing theinformation about the connection status (connected, unconnected, setmembership of a communications port, etc.) of the communications porthaving the port number of #0; reference numeral 1806 denotes a fieldstoring the information about the connection status (connected,unconnected, set membership of a communications port, etc.) of thecommunications port having the port number of #1; reference numeral 1807denotes a field storing the information about the connection status(connected, unconnected, set membership of a communications port, etc.)of the communications port having the port number of #2.

[0161] When a node which transmits a self-ID packet has the capabilityof functioning as a bus manager, the contender bit shown in the field1803 is set to 1. If it cannot function as a bus manager, then thecontender bit is set to 0.

[0162] A bus manager is a node having the function of managing theelectric power of a bus (managing information about whether or not thepower can be supplied through a communications cable, whether or not thesupply of power is required, etc. for each node), managing speedinformation (managing the maximum transfer speed between nodes accordingto the information about a transfer speed capable of correspondence ofeach node), managing the topology map information (managing theconnection configuration of a network according to the set membership ofa communications port), optimizing a bus according to the topology mapinformation, etc. based on various information contained in the abovementioned self-ID packet, and providing the information for other nodes.Using the functions, a bus manager node can manage the bus of the entire1394 network.

[0163] After the process in step S1706, the node which has set the nodeID determines whether or not there is a parent node (step S1707). Ifthere is the parent node, then the parent node performs again theprocesses in and after step S1702, and gives permission to a node whosenode ID has not been set.

[0164] If there is no parent node, then the node is determined to be aroot. The root determines whether or not node IDs have been set for thenodes connected to all child ports (step S1708).

[0165] If the ID setting process has not been completed on all nodes instep S1708, then the root gives permission to the child port having thesmallest number to set an ID in the child ports including the node (stepS1701). Then, it performs the processes in and after step S1702.

[0166] When the ID setting process is completed on all nodes, the rootsets its own node ID (step S1709). After setting the node ID, the rootbroadcasts a self-ID packet (step S1710).

[0167] By performing the above mentioned processes, the 1394 network canautomatically assign a node ID to each node.

[0168] If a plurality of nodes can function as bus managers after the IDsetting process, then the node having the largest node number can be abus manager. That is, if the root having the largest node number in thenetwork can function as a bus manager, then the root is the bus manager.

[0169] However, if the root cannot function as a bus manager, then thenode having the second largest node number becomes a bus manager. Whichnode is a bus manager can be pointed out by checking the contender bit1803 in the self-ID packet broadcast by each node.

[0170] (9) Arbitration

[0171]FIGS. 19A and 19B show an arbitration in the 1394 network shown inFIG. 1.

[0172] In the 1394 network, the arbitration for a bus-use right isperformed before a data transfer. The 1394 network is a logical bus typenetwork, and can transfer the same communications packet to all nodes inthe network by relaying a communications packet transferred from eachnode through other nodes. Therefore, to prevent the conflict amongcommunications packets, the arbitration is required. Thus, only one nodecan transfer a packet in a given time.

[0173]FIG. 19A shows the case in which a request for a bus-use right isissued by the nodes B and F.

[0174] When the arbitration starts, the nodes B and F issues a requestfor a bus-use right to the respective parent nodes. The parent node(that is, the node C) receiving the request from the node B relays thebus-use right to its parent node (that is, the node D). The request istransmitted to the root (node D) for final arbitration.

[0175] Upon receipt of the bus-use request, the root determines whichnode is to use the bus. The arbitration can be performed only by thenode which can function as a root, and a node winning in the arbitrationis given permission for use of bus.

[0176]FIG. 19B shows an accepted request of the node F and a rejectedrequest of the node B.

[0177] The root transmits a node losing in the arbitration a DP (dataprefix) packet to notify the node of the rejection. The rejected nodesets its bus-use request on standby until the coming arbitration.

[0178] By controlling the arbitration as described above, the 1394network can manage the bus-use right.

[0179] (10) Communications Cycle

[0180] The isochronous transfer mode and the asynchronous transfer modecan coexist in a time division manner in each communications cycleperiod. The period of a communications cycle is normally 125 μS.

[0181]FIG. 20 shows the case in which the isochronous transfer mode andthe asynchronous transfer mode coexist in one communications cycle.

[0182] The isochronous transfer mode is prioritized over theasynchronous transfer mode because it is set such that the idle period(subaction gap) required to activate an asynchronous transfer is setlonger than the idle period (isochronous gap) required to activate anisochronous transfer after a cycle start packet. Thus, the isochronoustransfer is prioritized in execution over the asynchronous transfer.

[0183] In FIG. 20, when each communications cycle starts, a cycle startpacket (hereinafter referred to as a CSP) is transferred from apredetermined node. Each node can count the same time as other nodes byadjusting the time using the CSP.

[0184] (11) Isochronous Transfer Mode

[0185] The isochronous transfer mode is a synchronization type transfersystem. The isochronous mode transfer can be executed in a predeterminedperiod after starting the communications cycle. The isochronous transfermode is performed for each cycle to maintain a real time transfer.

[0186] The isochronous transfer mode is a transfer mode appropriate forthe transfer of data which requires a transfer in real time such asmoving picture data, voice data, etc. The isochronous transfer mode isnot one-to-one communications as the asynchronous transfer mode, butcorresponds to broadcasting communications. That is, a packettransmitted from a node is uniformly transferred to all nodes in thenetwork. The isochronous transfer has no ack (acknowledgment code).

[0187] In FIG. 20, channel e (ch e), channel s (ch s), and channel k (chk) indicate the periods in which each node performs an isochronoustransfer. The 1394 interface assigns different channel numbers todistinguish a plurality of different isochronous transfers. Thus, theisochronous transfer can be performed between a plurality of nodes. Thechannel number does not specify a destination, but only assigns alogical number to data.

[0188] The isochronous gap shown in FIG. 20 indicates the idle state ofa bus. After passing a predetermined time in the idle state, a noderequesting an isochronous transfer determines that a bus can be used,and performs the arbitration.

[0189]FIG. 21 shows a format of a communications packet transferred inthe isochronous transfer mode. The communications packet transferred inthe isochronous transfer mode is referred to as an isochronous packet.

[0190] In FIG. 21, the isochronous packet is formed by a header unit2101, a header CRC 2102, a data unit 2103, and a data CRC 2104.

[0191] The header unit 2101 includes a field 2105 storing a data lengthof the data unit 2103, a field 2106 storing format information about anisochronous packet, a field 2107 storing a channel number of anisochronous packet, a field 2108 storing a transaction code (tcode)identifying the format of a packet and a process to be performed, and afield 2109 storing a synchronization code.

[0192] (12) Asynchronous Transfer Mode

[0193] An asynchronous transfer mode is an asynchronization typetransfer system. The asynchronous transfer can be performed from thecompletion of the isochronous transfer period to the start of the nextcommunications cycle (that is, the period up to the transfer of the CSPof the next communications cycle).

[0194] In FIG. 20, the initial subaction gap indicates the idle statusof a bus. After the idle time has reached a predetermined value, a noderequesting the asynchronous transfer determines that a bus can be used,and performs arbitration.

[0195] The node which has obtained a bus-use right by the arbitrationtransfers the packet shown in FIG. 22 to a predetermined node. The nodereceiving the packet returns an ack (acknowledgment code) or a responsepacket after the ack gap.

[0196]FIG. 22 shows a format of a communications packet in anasynchronous transfer mode. The communications packet transferred in theasynchronous transfer mode is referred to an asynchronous packet.

[0197] In FIG. 22, the asynchronous packet is formed by a header unit2201, a header CRC 2202, a data unit 2203, and a data CRC 2204.

[0198] In the header unit 2201, a field 2205 stores a node ID of adestination node, a field 2206 stores a node ID of a source node, afield 2207 stores a label indicating a series of transactions, a field2208 stores a code indicating a retransmission status, a field 2209stores the format of a packet and a transaction code (tcode) identifyinga process to be performed, a field 2210 stores the priority, a field2211 stores a destination memory address, a field 2212 stores the datalength of a data unit, and a field 2213 stores an extended transactioncode.

[0199] An asynchronous transfer is a one to one communications from anode to its partner node. A packet transferred from a source node isdistributed to each node in the network, but all but the destinationaddress are ignored. Therefore, the packet can be read by thedestination node only.

[0200] When the time to transfer the next CSP is reached during theasynchronous transfer, the transfer is not compulsorily interrupted, butthe next CSP is transmitted after the transfer is completed. Thus, whena communications cycle continues for 125 μS or longer, the nextcommunications cycle period is shortened. Thus, the 1394 network canhold a substantially constant communications cycle.

[0201] (13) Device Map

[0202] Means for an application obtaining the topology of the 1394network to generate a device map can be the following means inaccordance with the IEEE 1394 Standard.

[0203] 1. reading a topology map register of a bus manager

[0204] 2. estimation from a self-ID packet at a bus reset

[0205] However, in the above mentioned means 1 and 2, the topology inthe order of cable connection by the set membership of each node can beobtained, but no topology of the physical correspondence in positioncannot be obtained (there can also be the problem that unimplementedport can be viewed).

[0206] Furthermore, the information for generation of a device map canbe held as a database other than configuration ROM. In this case, meansfor obtaining various information depends on the protocol for access toa database.

[0207] The configuration ROM itself and the function of reading theconfiguration ROM are held by the device in accordance with the IEEE1394 Standard without fail. Then, by providing the function of storingthe information about the position, function, etc. of a device in theconfiguration ROM of each node, and reading the information from theapplication, the application of each node can implement the function ofdisplaying a device map independent of a specific protocol such as adatabase access, a data transfer, etc.

[0208] The configuration ROM can store a physical position and afunction as information specific to a node, and can be used to realizethe function of displaying a device map.

[0209] In this case, means for an application obtaining a 1394 networktopology by a physical correspondence in position can be a method ofobtaining the topology of the 1394 network by reading the configurationROM of each node at a bus reset or a request from a user. Furthermore,by reading the configuration ROM by describing not only the physicalposition of a node in the configuration ROM, but also various nodeinformation such as a function, etc., the physical position of a nodeand the function information about each node can be obtained. When theapplication obtains the configuration ROM information about each node,an API for obtaining arbitrary configuration ROM information about aspecified node is used.

[0210] Using the above mentioned means, the application of the device inthe IEEE 1394 network can generate various device maps depending on theuses such as a physical topology map, a function map of each node, etc.,thereby allowing a user to select a device having a necessary function.

[0211] <Outline of SBP-2>

[0212] The SBP-2 (serial bus protocol 2) is an IEEE 1394 bus dependentprotocol which has been examined for standardization since 1996 as theproject of the Technical Committee T10 under NCITS, and recognized asstandardized ANSI NCITS 325-1998 in 1998. In layers, it is a high ordercommand/data transport protocol over the transaction layer in IEEE1394-1955. At first, the SBP-2 has been developed to enable a device inthe IEEE 1394 to be operated by using an SCSI command. However, not onlyan SCSI command, but also other commands can be used.

[0213] The features of the SBP-2 are described below.

[0214] In a master slave model with an initiator/target configuration,an initiator is a master, and has all rights and responsibility inlogin, logout, task management, issuing a command, etc.

[0215] A shared memory model has the features of the IEEE 1394 as a busmodel. (The contents of a request to a target such as a command, etc.are basically stored in the system memory, and the target which receivesthe request reads the contents of the system memory. Otherwise, theinformation such as a status requested by the system, etc. is written).That is, since the resources for communications can be concentrated inone position, the load of the resources can be reduced. Furthermore,since the target can read and write to the system memory at any speed,the design can be freely performed, and a high-speed process can beeasily performed by accessing the system memory through H/W. (either ahigh performance model, or a low cost model can be realized). Sincethere is a system of describing a command group for exchanging messagesas a series of link lists, the lowered efficiency by latency can beoffset, high efficiency data communications can be realized by thefeature of high-speed process of the IEEE 1394 bus.

[0216] With the command set independent structure, (various command setscan be utilized) the SBP-2 is a master slave model in which an initiatoris a master and has all rights and responsibility, and even event startsfrom the operation of the initiator. Login and logout requests, a taskmanagement request, a command, etc. from the initiator are enclosed by adata structure referred to as an ORB (operation request block), andtransmitted to a target. (Correctly, the initiator stores them in itsmemory, and the target reads them). FIG. 23 shows the main type of ORB.

[0217] Dummy ORB: When the target fetch agent is initialized, it is usedin canceling a task, etc. The target processes it as no operation.

[0218] Command Block ORB: Includes commands such as data transfercommand, device control command, etc. It has data_descriptor anddata_size field indicating the address and size of the correspondingdata buffer or page table. Since it has a next ORB field indicating theaddress of the next Command Block ORB, the commands can be linked.(Refer to FIG. 24).

[0219] Management ORB: Includes a management request (access requestsincluding login and logout, and task management request). It has afunction field indicating a task management request (Abort Task Set,Target Reset, etc.), and StatusFIFO Field indicating the address of acompletion status from the target. (Refer to FIG. 25). Among them, forthe Management ORB, the initiator cannot issue the next ORB until thetarget returns a response, but the Command Block ORB including the DummyORB can be issued as a series of commands in the form of a Linked Listas shown in FIG. 26. That is, since the Command Block ORB has a fieldindicating the address of the next ORB as the next ORB field as shown inFIG. 2, commands can be linked sequentially. When the field is null, itindicates that there are no subsequent ORB.

[0220] In other fields of the Command Block ORB, there are Field (datadescriptor and data size) indicating the address and size of Data Bufferor PageTable. If the contents of Command are Write Command, the targetaccesses the Data Buffer in the system memory indicated bydata_descriptor, and reads Write Data therefrom. If the contents ofCommand are Read Command, the target accesses the Data Buffer in thesystem memory indicated by data_descriptor, and writes Data requested bythe Command. FIGS. 27 and 28 show the case in which Databuffer isdirectly indicated, and the case in which it is indicated throughPageTable. Page Table allows the Data buffer in physically discontinuousareas to be processed continuously, thereby requiring no physicalrearrangement of continuous logical areas using virtual storage.

[0221] The system on the target side for performing various requestsfrom the initiator is referred to as Agent. The Agent can be ManagementAgent for performing Management ORB, and Command Block Agent forperforming Command Block ORB.

[0222] The Management Agent has Management Agent Register so that theinitiator can notifies the target of the address of Management ORB.

[0223] The Command Block Agent fetches a command from the Command LinkedList of the initiator, and is referred to as a fetch agent. The fetchagent has an ORB Pointer Register for use by the initiator to store theleading address of the Command Block ORB, and the Command Block AgentRegister containing Door Bell Register through which the initiatornotifies the target that the Command is to be fetched.

[0224] When the target completes the execution of the ORB from theinitiator, it stores the Status of the completion of the execution inthe form of the data structure of Status Block (regardless of thesuccessful or unsuccessful completion) at the address indicated by thestatus FIFO address of the initiator. FIG. 29 shows an example of StatusBlock.

[0225] The target can store the maximum of 32-byte status information.In the case of the Management ORB, the status FIFO address is explicitlyprovided as a part of the ORB for the Status FIFO field shown in FIG.25. Therefore, the target stores the Status Block at a specifiedaddress. In other cases, the Status Block is stored in the status FIFOobtained from the Context of the Fetch agent. In the case of Commandblock ORB, the initiator provides the status FIFO address as a part of alogin request.

[0226] Normally, the target returns a response by writing the StatusBlock at the status FIFO address in response to the ORB issued by theinitiator. However, if a change occurs on the Device side, andinfluences the Logical Unit, then it autonomously returns theUnsolicited Status without a request from the initiator. In this case,the status FIFO address is status FIFO address provided by the initiatorwhen initiator issues a login request.

[0227] The operations of the initiator and the target in the SBP-2 isexplained using an operation model shown in FIG. 30.

[0228] The operation in the SBP-2 starts with the issue of theManagement ORB (LoginORB) by the initiator for a Login request to thetarget. In response to the request from the initiator, the targetreturns a Login response. When the Login request is accepted (refer toFIG. 30), the target returns the leading address of the Command BlockAgent Register as a Login Response.

[0229] When the Login request is accepted, the Management Agent of thetarget receives the subsequent Task Management from the initiator. Theinitiator issues the Task Management ORB, and transmits/receivesnecessary information in performing a task to and from the target.

[0230] In response to the ORB from the initiator, the target returns aresponse by writing the Status Block to the Status FIFO. However, when achange occurs on the device side, and influences the Logical Unit, thenit autonomously returns an unsolicited status without a request from theinitiator as described above. After communications relating to the TaskManagement, the initiator forms the necessary Command Block ORB (list)in its own memory area, and writes the leading address of the ORB to theORB Pointer of the Command Block Agent Register of the target, or ringsthe Door Bell Register of the Command Block Agent Register that there isthe ORB in the initiator to be transmitted to the target (FIG. 31). Thetarget accesses the memory of the initiator according to the leadingaddress information of the ORB written to the ORB Pointer, andsequentially processes the ORB (FIG. 32).

[0231] The execution Model of the Task can be Ordered Model andUnordered Model. In the Ordered Model, the ORB is processed in the orderof the list, and the completion status of the target is sequentiallyreturned. In the Unordered Model, there is no restrictions on theexecution order of the ORB, but the initiator is to be responsible forthe same execution result in any order. The data transfer from theinitiator to the target is performed by the Read Transaction from thetarget to the system memory. On the other hand, the data transfer fromthe target to the initiator is performed by the Write Transaction to thesystem memory. That is, the target leads the process regardless of thedirection of the transfer of the Data Buffer. Namely, the target canread data from the system memory at a convenient pace for the target.The initiator rewrites the next_address of the last ORB in the List tonext ORB address even while the target processes the ORB, and rings theDoor Bell Register of the target again to notify the target of thechange, thereby adding the ORB to the Linked List. The target returnsthe completion status (Status Block) to the status FIFO address of theinitiator. Upon receipt of the returned completion status (StatusBlock), the initiator is informed that the target has completed theprocess on the ORB to be processed. The completed ORB can be removedfrom the Linked List of the Task set (unless the next_ORB field isnull), and the initiator uses the available resources to add the nextcommand, if it is necessary, at the end of the Command Linked List.

[0232] Thus, the ORB is processed, and the task is executed.

[0233] If the task is completed, and it is not necessary to continueaccess, then the initiator issues a Logout ORB, and the target returns aresponse, and the Logout is completed.

[0234] <Description of the Central Portion of the Present Embodiment>

[0235] Described below are the configuration of the central portion ofthe present embodiment and the connection device.

[0236] First the configuration of the 1394 serial bus interface unit isdescribed as a common portion among the nodes of the host and theprinter connected to the IEEE 1394 bus.

[0237]FIG. 33 is a block diagram of the basic configuration of the 1394I/F block.

[0238] In FIG. 33, reference numeral 3302 denotes a physical layercontrol IC (PHYIC) for directly driving a 1394 serial bus, and realizesthe function of the physical layer in the above mentioned <Outline ofthe technology of IEEE 1394>. The main functions are bus initialization,arbitration, encoding/decoding transmission data code, monitoring cablepower, providing load terminating power (active connection recognition),interface with link layer IC.

[0239] Reference numeral 3301 denotes a link layer control IC (LINKIC)for performing an interface with the device main body and controllingdata transfer of the PHYIC, and realizes the function of the link layerin the above mentioned <Outline of the technology of IEEE 1394>. Themain functions of the IC are a transmission/reception FIFO fortemporarily storing the transmission/reception data through the PHYIC,preparing a packet of transmission data, determining by PHYIC whether ornot received data is to be transmitted to an assigned channel when thedestination of the received data is the node address or isochronoustransfer data, having the function of a receiver of checking an error inthe data, and the interface with the device body.

[0240] In FIG. 33, reference numeral 3304 denotes a CPU for controllingthe 1394 interface unit such as the link layer IC, PHYIC, etc. Referencenumeral 3405 denotes a ROM storing the controlling program of theinterface unit.

[0241] Reference numeral 3306 denotes a RAM, and is used as a databuffer storing transmission/reception data, a control work area, and adata area of various registers mapped at the 1394 address.

[0242] In FIG. 33, reference numeral 3303 denotes configuration ROM, andstores identification condition specific to each piece of equipment, acommunications condition, etc. The data format of the ROM is inaccordance with the format prescribed by the IEEE 1212 Standard and theIEEE 1394 Standard as described above in <Outline of technology of IEEE1394>.

[0243] Each node is provided with configuration ROM in the common formatas shown in FIG. 34. The software unit information of each device isstored in the unit directory, and the information specific to node isstored in the node dependent info directory.

[0244] In the case of the printer according to the present inventionembodiment, to support the SBP-2 as a communications protocol, and toprovide two logical channels of the SBP-2 (hereinafter referred to asLUN), there are ID identifying the SBP-2 in the unit directory, and adirectory for identification of the two LUNs, that is, the LUNs 0 and 1.

[0245] As described above by referring to the <Outline of technology ofIEEE 1394>, the last 28 bits in the address settings of the 1394 serialbus are reserved as an area of unique data of each piece of equipmentwhich can be accessed by other devices connected to a serial bus. FIG.35 shows the 28-bit address space.

[0246] In the area at the address numbers 0000 to 0200, a CSR coreregister group is arranged.

[0247] These registers exist as the basic functions for node managementdetermined by the CSR architecture as shown in FIG. 11.

[0248] The area at the address numbers 0200 to 0400 is defined as anarea storing a register for a serial bus by the CSR architecture. InFIG. 36, as described above in the <Outline of technology of IEEE 1394>,the register at the address numbers 0200 to 0230 is defined, and theregister is arranged for synchronization of data transfer, power supply,bus resource management, etc. This portion is the same as the portionshown in FIG. 12.

[0249] The above mentioned configuration ROM is arranged in the area atthe address numbers 400 to 800.

[0250] The area at the address numbers 0800 to 1000 stores the topologyinformation about the current 1394 bus, or the information about thetransfer speed between nodes.

[0251] The area at and after the address number 1000 is referred to as aunit space, and a register for the operation specific to each device isarranged. In this area, a register group prescribed by a high orderprotocol supported by each device, a data transfer memory mapped bufferarea, and a register specific to each equipment are arranged.

[0252] The operations of the host and printer shown in FIG. 1 andprovided with the 1394 interface are described below. In FIG. 1, asdescribed above, the host 1 a as an initiator using the SBP-2 protocolis a system for performing communications with the printer device 1 bwhich is the target of SBP-2. In the case of the communications system,communications are established between the host and the printer based onthe printer control communications command protocol predetermined as ahigh order command set of the SBP-2 protocol, and a process is performedaccording to the specification of a command.

[0253] The printer of the target 1 b is provided with a plurality oflogical units LUN 0 and LUN 1 which provide the function of receivingand processing the printer control data transmitted from the host to theprinter, and the print data, and the function of transmitting thecurrent printer status data to the host corresponding to the control tothe printer. Additionally, it is provided with a management agent MA forprocessing a management request such as establishing and disconnecting acommunications channel for the plurality of logical units.

[0254] The logical units LUN 0 and LUN 1 respectively manage the systemsreferred to as fetch agents FA0 and FA1 formed by command block agentsCA 0 and CA 1 for transmission and reception of data according to theSBP-2 protocol, and execution agents EA 0 and EA 1 for performing apredetermined process corresponding to data and a command. When theinitiator 1 allows any of the logical units LUN 0 and LUN 1 of thetarget 2 to perform a predetermined function, the fetch agent of thelogical unit LUN 0 and LUN 1 performs the predetermined process.

[0255] Each of the fetch agents sequentially processes the ORB issued bythe initiator according to the Ordered Model in the SBP-2, therebyperforming the predetermined process.

[0256] In the printer control communications command protocol used inthe present embodiment, the LUN 0 is used as a data transfer channelfrom a host to a printer as model specifications, and the LUN 1 is usedas a data transfer channel from the printer to the host.

[0257] According to the present embodiment, the initiator is appended tothe memory area according to the SBP-2 protocol for data communications,and command information defined by the printer control communicationscommand protocol is added to the command set dependent field of the ORBreceived by the fetch agent of the target. The print data which isapplication data, and printer status data are stored in the data bufferreferred to by the ORB.

[0258] The format of the ORB is shown in FIG. 37. FIG. 38 shows thecommand of the printer control communications command protocol used inthe present embodiment.

[0259] The host 1 which is an initiator connects the logical units LUN 0and LUN 1 of the printer to the target 2 to perform a print job.

[0260] Upon receipt of a request to start communications to the logicalunits LUN 0 and LUN 1 from the host to the printer, that is, a loginrequest, the management agent MA returns, a response containing a baseaddress which is an entry point for access to the fetch agents FA 0 andFA 1 for management of the corresponding logical unit to the initiatoras a login response, thereby permitting the initiator 1 to establishcommunications.

[0261] The host issues a login request to the LUN 0 and LUN 1, andstarts communications if the communications are permitted.

[0262] When application data including a control command is transmittedfrom the host to the printer, the direction bit of the ORB is set to 0in the LUN 0 logical channel, that is, reading a target of thecorresponding data buffer is specified to add a predetermined writecommand, the ORB prepared in the data buffer is appended to theapplication data, and fetch of the ORB is triggered for the fetch agentof the printer.

[0263] The target which receives a fetch activation request by theaccess of the ORB pointer fetches the ORB according to the pointerinformation included in the request using the read transaction of theIEEE 1394. The data buffer is accessed according to the command added tothe ORB. In this case, the write command to the LUN 0, that is, the datatransfer from the host to the printer, is executed, and the fetch agentperforms the process of reading data from the data buffer. The executionagent performs an operation according to the read application data. Theoperation includes, for example, transmitting control data from a hostto a printer by transmitting print data and the print specify command,initializing printer device, etc.

[0264] When the host requests to obtain the status of the printer duringthe print job, a data buffer for storing the status information isprepared, the pointer information and the ORB obtained by adding theread command are appended, and the ORB fetch is triggered for theprinter LUN 1 logical channel fetch agent.

[0265] As in the NUN 0, the target which receives a fetch activationrequest by the access of the ORB pointer fetches the ORB according tothe pointer information contained in the request using the readtransaction of the IEEE 1394. The data buffer is accessed according tothe command added to the ORB. In this case, the read command to the LUN1 is issued, that is, the data transfer is performed to the host bywriting data from the printer to the host. The execution agent preparesstatus data at a status obtain request, and the fetch agent performs theprocess of writing status data to the data buffer.

[0266] As described above, the print job is constantly performed. Then,the operation performed when data transfer relating to the print jobbecomes stagnant for any reason is described below by referring to anexample.

[0267] As described above, if the printing process is interrupted andcannot be resumed by the no-ink or paper-jam state when data transfer isperformed while the print job is performed using two logical channels ofthe LUN 0 and LUN 1, then the data fetched by the fetch engine throughthe LUN 0 and obtained as print data by the print buffer in the printerby the execution agent cannot be used in the printing process. Thus, ifthe data in the print buffer is not processed, the execution agent andthe fetch agent stop their operations because they cannot perform thedata transfer process.

[0268] As a result, the data transfer of the logical channel of the LUN0 becomes stagnant.

[0269] The data transfer layer in the printer control software on thehost side detects the data transfer error with the printer with thelapse of time for a predetermined data transfer time-out, and notifiesthe high order printer control application layer of the data writeerror.

[0270] The high order application layer of the host which receives thedata transfer error detects the printer error status, and issues to theprinter a command to initialize the printer.

[0271] When the printer initialize command is issued, it is the datatransfer from a host to a printer, and data is transferred through theLUN 0 logical channel.

[0272] The data transfer layer sets the ORB direction bit to 0 in theLUN 0 logical channel, the ORB to which a predetermined init command isadded is appended, and the ORB fetch is triggered for the fetch agent ofthe printer.

[0273] However, as described above, the data transfer is stagnantthrough the LUN 0, and the fetching operation is not performed by theprinter on the ORB with the initial command added, and the command issuebecomes data transfer time-out.

[0274] Described below is the portion different from the example of thecommunications system according to the present embodiment.

[0275] The printer control communications command protocol used in thepresent embodiment can use the LUN 0 as a data transfer channel from ahost to a printer as model specifications, use the LUN 1 as a datatransfer channel from the printer to the host, that is, use the logicalchannel depending on the data transfer direction. However, in anexception, a command can be issued from the host through both logicalchannels of the LUN 0 and the LUN 1 only by the printer initializecommand, and it can be received by the printer.

[0276] It is not realized by specifying the issue of the printerinitialize command in the data buffer referred to by the pointer fromthe ORB, but is realized by specifying it in the command set dependentfield of the ORB.

[0277] When the issue of the ORB to the LUN 0 logical channel with theinitialize command added encounters a data transfer time-out, the datatransfer layer in the printer control software of the host issues theORB to the LUN 1 logical channel with the same initialize command added.

[0278] The LUN 1 logical channel, that is, the ORB appended to thepredetermined LUN 1 as a data transfer channel from the printer to thehost, is read by the LUN 1 fetch engine of the printer. To the ORBissued to the LUN 1, the execution agent performs data write to the eachspecified data buffer at a command other than the initialize command.However, according to the specifications of the printer controlcommunications command protocol used in the present embodiment, theprinter initializing operation is performed after detecting theinitialize command in the ORB.

[0279] In the above mentioned embodiment of the present invention, theserial bus can be a bus disclosed in the IEEE 1394 Standard, but canalso be a bus applicable to the USB Standard.

[0280] Although a host computer is disclosed as an initiator and an inkjet printer is disclosed as a target according to the presentembodiment, the present invention does not limit the type of device.That is, other types of devices can be applied. For example, a digitalcamera can be used as an initiator, and a hard disk unit can be used asa target device.

[0281] Additionally, according to the present embodiment, acommunications channel (logical channel) in accordance with the IEEE1394 Standard as a logical unit is exemplified. However, any logicalchannel can be used depending on the type of serial bus according to thepresent invention. The method of using a data buffer corresponding to alogical unit can be any other variation than the one exemplified in thepresent embodiment.

[0282] Although the communications channel (LUN) from a conventionalinitiator to a target enters communications disabled status for anyreason, and a command cannot be smoothly issued by utilizing thefeatures of the SBP-2 and allowing a part of a control command issuedfrom an initiator to a target to be issued to and received by any LUNwhen one LUN is used in the data communications from an initiator to atarget while another LUN is used in the data communications from atarget to an initiator in the method of using a data buffercorresponding to the ORB of each LUN between the devices communicatingwith the configuration of a plurality of logical units (LUN) of theSBP-2, a control command can be issued using another channel, and theinitialize command in the stagnant communications channel can be issuedto the target according to the present embodiment.

[0283] Although when a logical communications unit from an initiator toa target becomes disabled for any reason, and a command cannot besmoothly issued, another logical communications unit can be used toissue a control command, thereby issuing an initialize command of thestagnant communications unit to the target according to the presentinvention.

What is claimed is:
 1. A data processing method for use between twonodes which are connected to a serial bus and perform communications bya plurality of logical communications units, wherein: in the pluralityof logical communications units, a first logical communications unit isused in data communications from an initiator to a target, and a secondlogical communications unit is used in data communications from a targetto an initiator; and a control command issued from the initiator to thetarget can be issued to and received by both way logical communicationsunits.
 2. The data processing method according to claim 1, wherein saidserial bus is a bus adapted to an IEEE 1394 Standard.
 3. The dataprocessing method according to claim 1, wherein one of said nodes is aprinter.
 4. The data processing method according to claim 1, whereinsaid serial bus is adapted to an USB Standard.
 5. The data processingmethod according to claim 1, wherein said target is a printer.
 6. Thedata processing method according to claim 1, wherein said initiator is ahost.
 7. The data processing method according to claim 6, wherein saidlogical communications unit is a logical unit (LUN) in an SBP-2Standard.
 8. A data processing apparatus for use between two nodes whichare connected to a serial bus and perform communications by a pluralityof logical communications units, wherein: in the plurality of logicalcommunications units, a first logical communications unit is used indata communications from an initiator to a target, and a second logicalcommunications unit is used in data communications from a target to aninitiator; and a control command issued from the initiator to the targetcan be issued to and received by both logical communications units. 9.The data processing apparatus according to claim 8, wherein said serialbus is a bus adapted to an IEEE 1394 Standard.
 10. The data processingapparatus according to claim 8, wherein one of said nodes is a printer.11. The data processing apparatus according to claim 8, wherein saidserial bus is adapted to an USB Standard.
 12. The data processingapparatus according to claim 8, wherein said target is a printer. 13.The data processing apparatus according to claim 8, wherein saidinitiator is a host.
 14. The data processing apparatus according toclaim 8, wherein said logical communications unit is a logical unit(LUN) in an SBP-2 Standard.
 15. A communications protocol between twonodes of a host and a printer connected to a communications control busin accordance with an IEEE 1394, wherein as a method of using a databuffer corresponding to each of a plurality of logical units amongdevices communicating with a configuration of a plurality of logicalunits in an SBP-2, a plurality of first logical communications units areused in data communications from an initiator to a target, and aplurality of second logical communications units are used in datacommunications from a target to an initiator, and a control commandissued from the initiator to the target can be issued to and received bya plurality of both logical communications units.
 16. The communicationsprotocol according to claim 15, wherein said target is a printer. 17.The communications protocol according to claim 15, wherein saidinitiator is a host.
 18. A printer executing a communications protocolaccording to claim
 15. 19. A host computer executing a communicationsprotocol according to claim
 15. 20. The data processing method,apparatus, and communications protocol according to claims 1 to 15,wherein said data buffer corresponds to an ORB of each LUN.
 21. A dataprocessing program for use between two nodes which are connected to aserial bus and perform communications by a plurality of logicalcommunications units, wherein: in the plurality of logicalcommunications units, a first logical communications unit is used indata communications from an initiator to a target, and a second logicalcommunications unit is used in data communications from a target to aninitiator; a control command issued from the initiator to the target canbe issued to and received by both logical communications units.
 22. Acomputer-readable storage medium storing the program of claim
 21. 23. Acommunications device for communications using a first channel for usein a data transfer from a target to an initiator, and a second channelfor use in a data transfer from an initiator to a target, comprising: adetection unit for detecting an error when a specific command is issuedusing the first channel; and an issue unit for issuing a specificcommand using the second channel when said detection unit detects anerror.
 24. The communications device according to claim 23, wherein thespecific command includes an initialize command.
 25. The communicationsdevice according to claim 23, wherein said issue unit issues a commandby specifying a command not in a data buffer referred to by a pointerfrom an ORB, but in a command set independent area.
 26. Thecommunications device according to claim 23, wherein said detection unitdetects an error by a data transfer time-out.
 27. A communicationsmethod for communications using a first channel for use in a datatransfer from a target to an initiator, and a second channel for use ina data transfer from an initiator to a target, comprising: a detectingstep of detecting an error when a specific command is issued using thefirst channel; and an issuing step of issuing a specific command usingthe second channel when an error is detected in said detecting step. 28.The communications method according to claim 27, wherein the specificcommand includes an initialize command.
 29. The communications methodaccording to claim 27, wherein said issuing step issues a command byspecifying a command not in a data buffer referred to by a pointer froman ORB, but in a command set independent area.
 30. The communicationsmethod according to claim 27, wherein said detecting step detects anerror by a data transfer time-out.
 31. A communications program forcommunications using a first channel for use in a data transfer from atarget to an initiator, and a second channel for use in a data transferfrom an initiator to a target, comprising: a detecting step of detectingan error when a specific command is issued using the first channel; andan issuing step of issuing a specific command using the second channelwhen an error is detected in said detecting step.
 32. The communicationsprogram according to claim 31, wherein the specific command includes aninitialize command.
 33. The communications program according to claim31, wherein said issuing step issues a command by specifying a commandnot in a data buffer referred to by a pointer from an ORB, but in acommand set independent area.
 34. The communications program accordingto claim 31, wherein said detecting step detects an error by a datatransfer time-out.